package com.chatcompetition.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.chatcompetition.domain.model.UmsMenu;
import com.chatcompetition.domain.model.UmsMenuExample;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UmsMenuMapper extends BaseMapper<UmsMenu> {
    long countByExample(UmsMenuExample example);

    int deleteByExample(UmsMenuExample example);

    int deleteByPrimaryKey(Long id);

    int insert(UmsMenu record);

    int insertSelective(UmsMenu record);

    List<UmsMenu> selectByExample(UmsMenuExample example);

    UmsMenu selectByPrimaryKey(Long id);

    int updateByExampleSelective(@Param("record") UmsMenu record, @Param("example") UmsMenuExample example);

    int updateByExample(@Param("record") UmsMenu record, @Param("example") UmsMenuExample example);

    int updateByPrimaryKeySelective(UmsMenu record);

    int updateByPrimaryKey(UmsMenu record);

    // 使用注解定义 SQL 查询
    @Select("SELECT title FROM ums_menu WHERE level = #{level} AND app_status = 0")
    List<String> selectMenuTitlesByLevel(@Param("level") int level);
}